<?php
/**
 * Created by Haobin.
 * User: HaoBin
 * Date: 2016/8/20
 * Time: 16:49
 */
session_start();
require('../conn.php');
require('../functions.php');
require('admin.php');
if ($_POST) {
    $id = guolv($_POST['uid']);
    $link = guolv($_POST['domain']);
    $mysql->execute("update `link` set `link`='{$link}' where `id`='{$id}'");
    echo "<script>alert('修改成功');location.href='domainChange.php'</script>";
    exit;
} ?>

<?php include('head.php') ?>
<link rel="stylesheet" href="../editor/themes/default/default.css"/>
<link rel="stylesheet" href="../editor/plugins/code/prettify.css"/>
<script src="<?php echo $jquerysite ?>" type="text/javascript"></script>

<div class="container-fluid">
    <div class="row-fluid">
        <?php
        include('left.php'); ?>
        <div class="span9">
            <h1 class="page-title">域名修改</h1>
            <div class="well">
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <form id="tab" action="edit_domain.php" method="post">
                            <?php
                            $uid = guolv($_GET['uid']);
                            $row = $mysql->query("select * from `link` where `id`='{$uid}}' limit 1");
                            if (!$row) {
                                _location('domainChange.php', 301);
                                exit;
                            } else {
                                $data = $row[0];
                            } ?>
                            <input type="hidden" name="uid" value="<?php echo $uid ?>">
                            <label>当前域名：</label>
                            <input type="text" style="width:300px" name="domain" value="<?php echo $data['link'] ?>">
                            <label></label>
                            <button class="btn btn-primary"><i class="icon-save"></i> 修改</button>
                        </form>
                    </div>
                </div>

            </div>
        </div>
    </div>


</div>

<footer>
    <hr>

    <p class="pull-right"><!--power by right--></p>


    <p><!--power by --></p>
</footer>


<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="lib/bootstrap/js/bootstrap.js"></script>


</body>
</html>